/**
 * @Description: log指令
 * @author Beon
 * @date 2021/9/1
*/
import * as childProcess from 'child_process';
import {ErrorCatch} from '../decorators/errorCatch';
import '../utils/consoleColor';

export class Log{

	/**
	 * 进行add .操作
	 * @param {String} repoPath 执行路径
	 * @returns {Promise<void>}
	 */
	@ErrorCatch.errorNotice('自动add失败，请检查报错信息')
    static async lastLogTagName (repoPath?: string): Promise<string> {
        return (await childProcess.execSync('git log -1 --pretty=format:"%s"', { cwd: repoPath })).toString();
    }
}
